<?php
header('Access-Control-Allow-Origin: *');
header("content-type:text/html;charset=utf-8");
$link = mysql_connect('localhost', 'root', 'root') or die('数据链接失败');
mysql_select_db('lol', $link);
$sql = "select * from `pai`";
$res=mysql_query($sql);
$arr = [];
    if($res){
        while($row = mysql_fetch_assoc($res)){
            array_push($arr,$row);
        }
    }
    echo json_encode($arr);
?>